<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="velocity.js">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <button @click="show=!show">动画效果</button>
        <transition @before-enter="beforeEnter" @enter="enter" @leave="leave" v-bind:css="false">
            <p v-if="show">文字动画效果</p>
        </transition>
    </div>
<script src="vue.js"></script>
    <script>
        var vm=new Vue({
            el:'#app',
            data:{show:false,},
            methods:{
                beforeEnter(el){
                    el.style.opacity=0
                    el.style.stransformOrigin='left'
                    el.style.color='red'
                },
                enter(el,done){
                    Velocity(el,{opacity:1,fontSize:'1.4em'},{duration:300})
                    Velocity(el,{fontSize:'lem'},{complete:done})
                },
                leave(el,done){
                    Velocity(el,{translateX:'15px',rotateZ:'50deg'},{duration:3000})
                    Velocity(el,{rotateZ:"100deg"},{duration:300})
                    Velocity(el,{rotateZ:"45deg",translateY:'30px',translateX:"30px",opacity:0},{complete:done})

                }
            }
        })
    </script>
</body>
</html>